# Maintainer: Michał Adamski <michal@ert.pl>
pkgname=py3-python-socks
pkgver=2.4.4
pkgrel=0
pkgdesc="Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python"
options="!check" # Testsuite ships their own GLIBC version of 3proxy
url="https://github.com/romis2012/python-socks"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-async-timeout"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-curio py3-trio py3-pytest py3-yarl"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/python-socks/python-socks-$pkgver.tar.gz"
builddir="$srcdir/python-socks-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7238835bbcbd0d053b8526b24a614c2ae9204de3872b728d645c4efb45234e856ed1bd9b62b4ed7d67075f97f59c9dc9ae92ec264528bbfb573021fb4216214a  python-socks-2.4.4.tar.gz
"
